import { Entity, PrimaryGeneratedColumn, Column, ManyToOne } from 'typeorm'
import { Component } from './component.entity'

@Entity()
export class ComponentInput {
  @PrimaryGeneratedColumn()
  id: number

  @Column({
    comment: '属性'
  })
  attr: string

  @Column({
    comment: '说明'
  })
  title: string

  @Column({
    comment: '备注'
  })
  description: string

  @Column({
    comment: '类型'
  })
  type: string

  @Column({
    comment: '是否必填'
  })
  required: boolean

  @ManyToOne(type => Component, component => component.inputs)
  component: Component
}
